<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/1/26 0026
 * Time: 23:37
 */

$img = imagecreatefromjpeg('test.jpg');//imagecreatefromjpeg()  返回一图像标识符，代表了从给定的文件名取得的图像。
imagestring($img,5,10,10,'hello world',imagecolorallocate($img,0,255,0));
//imagestring  ( resource $image  , int $font  , int $x  , int $y  , string $s  , int $col  )
header('Content-type:image/png');
imagepng($img);